class LogData {
  userAgent
  platform
  location = {}
  level = 3
  type
  action
  value

  constructor ({
    level,
    type,
    action,
    value
  }) {
    if (window) {
      if (window.navigator) {
        this.userAgent = window.navigator.userAgent
        this.platform = window.navigator.platform
      }
    }
    if (location) {
      this.location.url = location.href
    }
    this.level = level
    this.type = type
    this.action = action
    this.value = value
  }

  toString () {
    return JSON.stringify(this)
  }
}
